@extends('layouts.header')
@section('title','待维修设备')
<div class="waitingForRepair">
    <div class="waitingForRepairList">
        @foreach($faults as $fault)
        <div class="items">
            <div class="neirong">
                <p><span>设备号：</span><span>{{$fault->chest->chest_number}}</span></p>
                <p><span>所在位置：</span><span>{{$fault->chest->address}}</span></p>
                <p><span>报修时间：</span><span>{{$fault->created_at}}</span></p>
                <p><span>设备问题：</span><span>{{$fault->fault_desc}}</span></p>
                <p><span>维修状态：</span><span>{{$fault->humanStatus}}</span></p>
            </div>
           {{-- <div class="anjiui">
                <div class="weixiuzhong" data-num="123123"><img src="{{asset('icon/daiweixiu@2x.png')}}" alt=""><span>维修中</span></div>
                <div class="weixiuwancheng" data-num="123123"><img src="{{asset('icon/wnacehng@2x.png')}}" alt=""><span>维修完成</span></div>
            </div>--}}
        </div>
        @endforeach
    </div>
</div>
@push('js')
<script>
    $(".weixiuzhong").click(function(){
        var num = $(this).attr("data-num");
        mui.confirm("确认开始维修? ", "提示", ["取消", "确认"], function(res){
            if (res.index == 1) {
                $("#isShow").show();
                $.ajax({
                    url: "",
                    type: "POST",
                    data: {

                    },
                    success: function(res){
                    },
                });
            }
        })
    });
    $(".weixiuwancheng").click(function(){
        var num = $(this).attr("data-num");
        mui.confirm("确认维修完成? ", "提示", ["取消", "确认"], function(res){
            if (res.index == 1) {
                // loding 显示
                $("#isShow").show();
                $.ajax({
                    url: "",
                    type: "POST",
                    data: {

                    },
                    success: function(res){
                        // loding 隐藏
                        $("#isShow").hide();
                    },
                });
            }
        })

    });
</script>

@endpush

